#include <stdio.h>
#include <stdlib.h>

int
main(void)
{
	int n;
	int i, j;
	int b;
	int T;

	scanf("%d", &n);

	i = j = 0;
	while (i < n) {
		b = j = 0;
		while (j < n) {
			scanf("%d", &T);
			if (T) b++;
			j++;
		}
		printf("%d%s", b, (i == n - 1) ? "\n" : " ");
		i++;
	}

	return (0);
}
